Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-register

Package Overview
Dependencies
Maintainers
5
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-register

babel require hook

  • 6.26.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
3.6M
increased by34.12%
Maintainers
5
Weekly downloads
 
Created

What is babel-register?

The babel-register package is a tool that allows you to compile ES6/ES7 code on the fly as you run your application. It hooks into Node's require system to automatically transpile files as they are loaded, making it easier to use modern JavaScript features without needing a separate build step.

What are babel-register's main functionalities?

On-the-fly Transpilation

This feature allows you to transpile ES6/ES7 code to ES5 on the fly. By requiring 'babel-register' at the beginning of your application, you can use modern JavaScript syntax in your Node.js projects without a separate build step.

require('babel-register')({
  presets: ['env']
});

// Now you can require ES6/ES7 modules
const myModule = require('./myModule');

Custom Configuration

You can customize the Babel configuration used by babel-register. This allows you to specify presets and plugins to tailor the transpilation process to your needs.

require('babel-register')({
  presets: ['env'],
  plugins: ['transform-runtime']
});

// Now you can require ES6/ES7 modules with custom Babel configuration
const myModule = require('./myModule');

Other packages similar to babel-register

FAQs

Package last updated on 16 Aug 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc